package com.sharer.last.fallback.factory;

import com.sharer.last.base.enums.ExceptionCode;
import com.sharer.last.base.model.R;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;


/**
 * 失败异常回调
 *
 * @ClassName CommonFeignFallbackFactory
 * @Author WangJin
 * @Date 2023/05/04/18:32
 * @Description
 * @Version 1.0
 */
@Slf4j
public class CommonFeignFallbackFactory implements FallbackFactory {
    @Override
    public R create(Throwable cause) {
        log.error("服务接口调用异常：", cause);
        return R.error(ExceptionCode.FAIL);
    }
}
